{% extends 'BWLwebshopBundle:Admin:orderTracking.html.twig' %}

{% block content %}
    <h1>Bedarfe</h1>
    <article class="box">
        <strong>Zeitraum:</strong>

        <form action="{{ path('bwl_webshop_orderTracking') }}"
              method="post" {{ form_enctype(form) }}>
            {{ form_errors(form) }}
            {{ form_row(form.from, { 'attr': {'class': 'idate'} }) }}
            {{ form_row(form.to, { 'attr': {'class': 'idate'} }) }}
            {{ form_rest(form) }}
            <br/>
            <input type="submit" value="Anzeigen" class="isubmit"/>
        </form>
    </article>

    <article class="box">
        <table class="dottedlight">
            <tr>
                <th>Produkt</th>
                <th>Datum</th>
                <th>Menge</th>
            </tr>

            {% for requirement in requirements %}
                <tr>
                    <td>{{ requirement.item.name }}</td>
                    <td>{{ requirement.date|date('d.m.Y') }}</td>
                    <td style="text-align: right">{{ requirement.amount }}</td>
                </tr>
            {% endfor %}

        </table>
    </article>
{% endblock %}